package com.nicefact.mailmonitor.vo;

import sample.appsforyourdomain.AppsForYourDomainClient;

import com.google.gdata.client.appsforyourdomain.AppsGroupsService;
import com.nicefact.mailmonitor.core.AppException;


public class DomainConfig {

	private String domainName;

	private String domainAdminEmail;

	private String domainAdminPassword;
	

	private AppsForYourDomainClient domainClient;

	/*
	 * Group service to handle group related request for google app domain.
	 */
	private AppsGroupsService groupsService;
	
	private String dataAdminEmail;

	private String dataAdminPassword;

	public String getDataAdminEmail() {
		return dataAdminEmail;
	}

	public void setDataAdminEmail(String dataAdminEmail) {
		this.dataAdminEmail = dataAdminEmail;
	}

	public String getDataAdminPassword() {
		return dataAdminPassword;
	}


	public void setDataAdminPassword(String dataAdminPassword) {
		this.dataAdminPassword = dataAdminPassword;
	}

	/**
	 * This will initialise various google app domain related services.
	 * 
	 * @throws AppException
	 */
	public void init() throws AppException {
		try {
//			domainClient = new AppsForYourDomainClient(domainAdminEmail, domainAdminPassword, domainName);
		//	groupsService =		new AppsGroupsService(domainName, "netkiller-ims");
		//	groupsService = domainClient.getGroupService();
			
		} catch (Exception e) {
			throw new AppException("Unable to create domain client.", e);
		}
	}

	public AppsForYourDomainClient getDomainClient() {
		return domainClient;
	}

	public void setDomainClient(AppsForYourDomainClient domainClient) {
		this.domainClient = domainClient;
	}

	public AppsGroupsService getGroupsService() {
		return groupsService;
	}

	public void setGroupsService(AppsGroupsService groupsService) {
		this.groupsService = groupsService;
	}

	public String getDomainName() {
		return domainName;
	}

	public void setDomainName(String domainName) {
		this.domainName = domainName;
	}

	public String getDomainAdminEmail() {
		return domainAdminEmail;
	}

	public void setDomainAdminEmail(String domainAdminEmail) {
		this.domainAdminEmail = domainAdminEmail;
	}

	public String getDomainAdminPassword() {
		return domainAdminPassword;
	}

	public void setDomainAdminPassword(String domainAdminPassword) {
		this.domainAdminPassword = domainAdminPassword;
	}
}
